


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet"
			type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
	</head>
	<body>

<html:form styleId="yfThesisForm" action="listYfThesis.do?method=getYfThesisPartialList">
	<input type="hidden" id="totalPage" value="${totalPage}" />
	<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margtb5">
				<tr>
					<td align="left" class="padl5 lan12">
						<img src="<%=path%>/images/img-11.gif" width="12" height="12"></img>
						成果管理 &gt; 论文书籍管理
					</td>
				</tr>
			</table>
			
			
			<table cellspacing="3" cellpadding="0" width="98%" align="center"
				border="0" class="kuang2 margtb5 hei12">
				<tr>
	
					  				    <td width="10%" align="right">
						<bean:message key="com.application.yfthesis.entity.yfthesis.listpage.thesisName" bundle="yfthesis"/>：
					</td>
					<td width="15%">
						                 		                      		          <html:text property="thesisName"/>
                		                                               		 					</td>
 
					  				    <td width="10%" align="right">
						<bean:message key="com.application.yfthesis.entity.yfthesis.listpage.author" bundle="yfthesis"/>：
					</td>
					<td width="15%">
						                 		                      		          <html:text property="author"/>
                		                                               		 					</td>
 
					  				    <td width="10%" align="right">
						<bean:message key="com.application.yfthesis.entity.yfthesis.listpage.domain" bundle="yfthesis"/>：
					</td>
					<td width="15%">
						                 		                 		       <ssh:select propertyName="domain" pid="DOMAIN" type="1" defaultName="${yfThesisForm.domain}"/>
                		 					</td>
                	<td width="10%" align="right">
						发表时间：
					</td>
					<td width="15%">
						   <input type="text" readonly="true"   name="publicationTimeStr" id="publicationTimeStr" readonly="true"  onclick="popUpCalendarDlg(this)" />
                	</td>
                  </tr>
                  <tr>
                  <td width="10%" align="right">
						项目名称：
					</td>
					<td width="15%">
						  <html:text property="projectName"/>
                	</td>
                	<td width="10%" align="right">
						项目机构：
					</td>
					<td width="15%">
							<ssh:select propertyName="projectOrg" firstShow="Y" dataSource="collection" selectList="${orgSelect}"  type="1" defaultName="${yfThesisForm.projectOrg}"/>
                	</td>
                	<td width="10%" align="right">
						审核状态：
					</td>
					<td width="15%">
						   <ssh:select propertyName="status" pid="AUDIT_STATUS_1" type="1" defaultName="${yfThesisForm.status}"/>
                	</td>
 
					  					<td width="12%">
					  					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						  <input  class="buttonbg" id="but_query" style="cursor:hand" type="button" value="<bean:message key='com.manager.common.yfthesis.query'  bundle="yfthesis"/>" name="but_query" onClick="query();" />
					</td>
				</tr>
				
			</table>
			
			
		   <table cellspacing="0" cellpadding="0" width="98%" align="center" border="0" class="margb5">
				<tr>
					<td colspan="8" class="bgcolor2 padlr5">
						<table border="0" cellspacing="0" cellpadding="0" class="lan13b">
							<tr>
							<td width="25" align="center"> <img src="<%=applicationPath%>/images/tianjia.gif" alt="<bean:message key='com.manager.common.yfthesis.add'  bundle="yfthesis"/>" height="15" width="15" /></td>
					        <td class="lieb-zi" width="40">
						<a href="#" onClick="addYfThesis();" ><bean:message key='com.manager.common.yfthesis.add'  bundle="yfthesis"/>
						</a>
					</td>
					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/bianji.gif" alt="<bean:message key='com.manager.common.yfthesis.modify'  bundle="yfthesis"/>" height="15" width="15" />
					</td>
					<td class="lieb-zi" width="40">
					     <a href="#" onClick="modifyYfThesis();" ><bean:message key='com.manager.common.yfthesis.modify'  bundle="yfthesis"/> </a>
					</td>

					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/shanchu.gif" alt="<bean:message key='com.manager.common.yfthesis.del'  bundle="yfthesis"/>" height="15" width="15" />
					</td>
					<td class="lieb-zi" width="40">
						<a href="#" onClick="delYfThesis();" ><bean:message key='com.manager.common.yfthesis.del'  bundle="yfthesis"/></a>
					</td>

                 <c:if test="${loginUser.isYFJL=='true'}">
					<td width="25" align="center">
						<img src="<%=applicationPath%>/images/chakan.gif" alt="<bean:message key='com.manager.common.yfthesis.view'  bundle="yfthesis"/>" height="15" width="15"/>
					</td>
					<td width="40" class="lieb-zi">
						<a href="#" onClick="view();"><bean:message key='com.manager.common.yfthesis.view'  bundle="yfthesis"/> </a>
					</td>
						<td width="25" align="center">
									<img src="<%=applicationPath%>/images/bianji.gif"
										alt="审核"
										height="15" width="15" />
								</td>
								<td width="100" class="lieb-zi">
									<a href="#" onClick="modifyStatus();">审核</a>
								</td>
								</c:if>
					<td class="lieb-zi">
						&nbsp;
					</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
			
		<fmt:bundle basename="com.application.yfthesis.struts.ApplicationResources_yfthesis">
		<display:table name="yfThesisList" class="simple" id="yfThesisTab" pagesize="15" partialList="true" style=" width:100%;" defaultorder="descending" size="resultSize" requestURI="listYfThesis.do?method=getYfThesisPartialList"  > 			       
									<display:column title="选择" sortable="false"  style=" width:5%; text-align:center;" >
			    <input type="checkbox" name="id" value="${yfThesisTab.id}"  />
			    <input type="hidden" id="${yfThesisTab.id}status" name="${yfThesisTab.id}status" value="${yfThesisTab.status}"/>
			    <input type="hidden" id="${yfThesisTab.id}operateid" name="${yfThesisTab.id}operateid" value="${yfThesisTab.operateid}"/>
			</display:column>
             
           <display:column  titleKey="com.application.yfthesis.entity.yfthesis.listpage.thesisName" sortable="true" style="width:15%; text-align:center;">
            <a style="color:blue;" href="#" onclick="showView('${yfThesisTab.id}')">${yfThesisTab.thesisName}</a> 
           </display:column>                												 
            <display:column property="author" titleKey="com.application.yfthesis.entity.yfthesis.listpage.author" sortable="true" style="width:5%; text-align:center;"/>
			<display:column property="domain" titleKey="com.application.yfthesis.entity.yfthesis.listpage.domain" sortable="true" style="width:5%; text-align:center;"  decorator="com.manager.commons.DictCodeColumnDecorator" dictCode="DOMAIN"/>
            <display:column format="{0,date,yyyy-MM-dd}" property="publicationTime" titleKey="com.application.yfthesis.entity.yfthesis.listpage.publicationTime" sortable="true" style="width:5%; text-align:center;" />
            								 
			  <display:column property="projectName" title="项目名称" sortable="true" style="width:15%; text-align:center;" />
		<display:column property="projectOrgName" title="项目机构" sortable="true" style="width:10%; text-align:center;" />                          												 
               <display:column property="status"   title="审核状态" decorator="com.manager.commons.DictCodeColumnDecorator" dictCode="AUDIT_STATUS_1" sortable="true" style="width:5%; text-align:center;" />
		</display:table>
	       </fmt:bundle>
		</td>
				</tr>
			</table>

		</html:form>
	</body>
</html>
<script>

function query(){
	document.forms[0].action="listYfThesis.do?method=getYfThesisPartialList";
	document.forms[0].submit();
}

//新增
function addYfThesis(){
    document.forms[0].action="toAddYfThesis.do?method=toAddYfThesis";
	document.forms[0].submit();
}

//修改
function modifyYfThesis(){
    var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	        alert("一次只能编辑一条记录！");
		return;
	}else{
	    var cheid = getCheckId().trim();
	    var operateid = cheid + "operateid";
	    var opid = $(operateid).value;
	    var currentid = '${loginUser.id}';
	    if(opid != currentid){
	           alert("只能编辑自己新增的记录！");
	           return;
	    }
		document.forms[0].action="toUpdateYfThesis.do?method=toUpdateYfThesis";
	        document.forms[0].submit();
	}
	
}

//删除
function delYfThesis()
{
	var ids = getSelectedIds('id');
	if( ids=="" )
	{
		alert("请选择一条记录！");
		return false;
	}
	if( confirm("是否要删除所选的信息？") )
	{
	    var cheid = getCheckId().trim();
	    var operateid = cheid + "operateid";
	    var opid = $(operateid).value;
	    var currentid = '${loginUser.id}';
	    if(opid != currentid){
	           alert("只能删除自己新增的记录！");
	           return;
	    }
		document.forms[0].action="deleteYfThesis.do?method=deleteYfThesis&ids=" + ids;
		document.forms[0].submit();
	}
}
	


//审核
function modifyStatus()
{
  var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	        alert("一次只能审核一条记录！");
		   return;
	}else 
	{
	    /**
		var status = getCheckId().trim();
	    var checkedName = status + "status";
	    var state = $(checkedName).value;
	 
	    if(state!=2){
	        alert("已经审核，不能重复审核！");
	        return;
	    }
		if( confirm("是否要修改审核状态为报销成功？") )
	   {
			document.forms[0].action="modifyStatus.do?method=modifyStatus";
		    document.forms[0].submit();
	   }
	   **/
	   document.forms[0].action="toAuditThesis.do?method=toAuditThesis";
	   document.forms[0].submit();
	
	}
}

function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}

//查看
function view(){
	var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	    alert("一次只能查看一条记录！");
		return;
	}else{
		document.forms[0].action="viewYfThesis.do?method=viewYfThesis";
	    document.forms[0].submit();
	}
}

//查看
function showView(id){ 
    document.forms[0].action="viewYfThesis.do?method=viewYfThesis&id=" + id;
	document.forms[0].submit();

}

	function getCheckId(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	return jysBox[i].value;
		}
	}
    return count;
}

//全选   
function checkAll()   
{ 
  
   var chk=document.getElementsByName("id");   
   for(var i=0;i<chk.length;i++)   
   { 
     if($('checkall').checked){
     	chk(i).checked=true; 
     }else{
        chk(i).checked=false; 
     } 
       
 }
  
}   
</script>
